import axios from 'axios'
import qs from 'qs'
import {Secret} from '@/assets/commonjs/utils.js';

/**
 * 基础模块
 */
export const Base = new class {
    constructor() {
        this.uploadApi = '/api/user/upload';  //上传
        this.sendcodeApi = '/api/sms/send';//验证码
        this.imgcodeApi = '/api/Captcha/get'; //图形验证码
        this.bankApi = '/api/user/getbank';//银行
        this.download = '/api/app/info'; //下载
        this.uploadWgtApi = '/api/upload/upFile';//上传wgt
        this.downloadWgtAPi = '/api/upload/downfile';//下载资源更新
        this.getVersionAPi = '/api/upload/getVersion'; //获取服务器版本号
        this.setLanguageApi = '/api/order/setLanguage'; //多语言设置
        this.getLanguageApi = '/api/order/getLanguage'; //设置后获取语言
        this.getlangApi = '/api/app/getlang'; //登陆页面多语言
        this.setLanguage2Api = '/api/app/setLanguage'; //设置多语言
    }
    
    setLanguage2(params) {
        return axios.get(this.setLanguage2Api, { params }).then((res) => res.data);
    }
    getlang(params) {
        return axios.get(this.getlangApi, { params }).then((res) => res.data);
    }
    getBank() {
        return axios.post(this.bankApi).then((res) => res.data);
    }
    upload(params) {
        return axios.post(this.uploadApi, params).then((res) => res.data);
    }
    sendCode(params) {
        return axios.post(this.sendcodeApi, qs.stringify(params)).then((res) => res.data);
    }
    getImgCode(params) {
        return axios.get(this.imgcodeApi, { params }).then((res) => res.data);
    }
    getDownload() {
        return axios.get(this.download).then((res) => res.data);
    }
    uploadWgt(params) {
        return axios.post(this.uploadWgtApi, params).then((res) => res.data);
    }
    getVersion(){
        return axios.get(this.getVersionAPi).then((res)=>res.data); 
    }
    setLanguage(params) {
        return axios.get(this.setLanguageApi,{params}).then((res) => res.data);
    }
    getLanguage() {
        return axios.get(this.getLanguageApi).then((res) => res.data);
    }
}

/**
 * 用户模块
 */
export const Init = new class {
    constructor() {
        this.registerApi = '/api/user/register';  //注册
        this.resetpwdApi = '/api/user/resetpwd';  //修改密码
        this.backpwdApi = '/api/user/getbackpass';  //忘记密码
        this.userApi = '/api/user/getinfo'; //用户信息
        this.capitalApi = ''; //用户资产
        this.realApi = '/api/user/changeisreal';  //实名认证
        this.loginApi = '/api/user/login';  //登录
        this.resetPayPwdApi = '/api/user/resetPayPwd';  //修改支付密码
        this.quitApi = '/api/user/logout';//退出登录
        this.sendApi = '/api/ems/send';//邮箱验证码
    }
    register(params) {
        return axios.post(this.registerApi, qs.stringify(params)).then((res) => res.data)
    }
    changePwd(params) {
        return axios.post(this.changepwdApi, qs.stringify(params)).then((res) => res.data)
    }
    backpwd(params) {
        return axios.post(this.backpwdApi, qs.stringify(params)).then((res) => res.data)
    }
    getUser(params) {
        return axios.post(this.userApi, qs.stringify(params)).then((res) => res.data)
    }
    getCapital(params) {
        return axios.post(this.capitalApi, qs.stringify(params)).then((res) => res.data)
    }
    toReal(params) {
        return axios.post(this.realApi, qs.stringify(params)).then((res) => res.data)
    }
    login(params) {
        return axios.post(this.loginApi, qs.stringify(params)).then((res) => res.data)
    }
    resetPayPwd(params) {
        return axios.post(this.resetPayPwdApi, qs.stringify(params)).then((res) => res.data);
    }
    quit() {
        return axios.get(this.quitApi).then((res) => res.data)
    }
    send(params) {
        return axios.post(this.sendApi, qs.stringify(params)).then((res) => res.data)
    }
    resetpwd(params) {
        return axios.post(this.resetpwdApi, qs.stringify(params)).then((res) => res.data)
    }
}

/**
 * 机器人
 */
export const Robot = new class {
    constructor() {
        this.showApi = '/api/newmachine/show';//机器人展示
        this.showorderApi = '/api/order/showorder';//订单详情
        this.buyRobotApi = '/api/order/buy';//购买机器人
        this.cancelRobotApi = '/api/order/cancel';//取消订单
        this.canceltipsApi = '/api/order/canceltips';//取消订单提示语
        this.showallorderApi = '/api/order/showallorder';//我的机器人
        this.upgradeApi = '/api/order/upgrade';//加金
        this.singleApi = '/api/newmachine/single';//机器人详情
    }

    show(params) {
        return axios.post(this.showApi, qs.stringify(params)).then((res) => res.data)
    }
    showorder(params) {
        return axios.post(this.showorderApi, qs.stringify(params)).then((res) => res.data)
    }
    buyRobot(params) {
        return axios.post(this.buyRobotApi, qs.stringify(params)).then((res) => res.data)
    }
    cancelRobot(params) {
        return axios.post(this.cancelRobotApi, qs.stringify(params)).then((res) => res.data)
    }
    canceltips(params) {
        return axios.post(this.canceltipsApi, qs.stringify(params)).then((res) => res.data)
    }
    showallorder(params) {
        return axios.post(this.showallorderApi, qs.stringify(params)).then((res) => res.data)
    }
    upgrade(params) {
        return axios.post(this.upgradeApi, qs.stringify(params)).then((res) => res.data)
    }
    single(params) {
        return axios.post(this.singleApi, qs.stringify(params)).then((res) => res.data)
    }
}


/**
 * 个人中心
 */
export const Owner = new class {
    constructor() {
        this.bespeakListApi = '';//预约列表
        this.teamApi = '/api/user/team';//团队
        this.kjfeeApi = '/api/user/getkjfee';//充值矿机费率
        this.payInfoApi = '/api/user/payinfo';//支付信息
        this.bindaliApi = '/api/user/uppay'; //支付宝绑定
        this.bindwechatApi = '/api/user/upwechar'; //微信绑定
        this.userCoinApi = '/api/user/getUserCoin'; //资产模块
        this.coinOrderApi = '/api/user/getCoinOrder';//明细 
        this.coinApi = '/api/user/getCoin';//矿机与推广收益
        this.transferApi = '/api/user/transfer';//转出
        this.shaituApi = '/api/usershow/add';  //晒图
        this.rechargeInfoApi = '/api/user/getRechargeInfo'; //矿机充值信息
        this.rechargeApi = '/api/user/addRechargeLog'; //充值信息
        this.booklistApi = '/api/booking/booking/getlog'; //预约记录
        this.sellInfoApi = '/api/order/order/getSellPay'; //预约记录
        this.bindbankApi = '/api/user/upbank'; //银行卡绑定
        this.payApi = '/api/order/order/payment'; //支付
        this.diallistApi = '/api/turntable/getlist';  //转盘奖品
        this.rewardApi = '/api/turntable/getreward';  //奖品

        // 矿机记录
        this.buystutasApi = '/api/order/order/buyStutas'; //抢矿中列表
        this.buystutas2Api = '/api/order/order/buyStutas2'; //抢矿收益中列表
        this.buyappealApi = '/api/order/order/buyAppeal'; //抢矿申诉列表

        // 转让记录
        this.sellstatusApi = '/api/order/order/sellStatus'; //待转让列表
        this.sellstatus2Api = '/api/order/order/sellStatus2'; //转让中列表
        this.sellstatus4Api = '/api/order/order/sellStatus4'; //转让完成列表
        this.sellappealApi = '/api/order/order/sellAppeal'; //转让申诉列表
        // 申诉记录
        this.setappealApi = '/api/order/order/setAppeal';  //申诉
        this.buyerApi = '/api/order/order/payment'; //买家信息

        this.contractApi = '/api/order/order/renewContract'; //续约

        this.sellLogApi = '/api/order/sell/getselllog';  //收益出售记录   !!!!暂时不用！！！
        this.setSellApi = '/api/order/sell/setselllog';  //收益出售

        this.applyApi = '/api/wallet/apply'; //提取
        this.applyLogApi = '/api/wallet/lists'; //提取记录
        this.rateApi = '/api/wallet/getRate'; //兑换比例
        this.exchangeRateApi = '/api/wallet/exchangeRate'; //兑换参数
        this.titleApi = '/api/notice/gettitles';  //公告
        this.noticeDetailApi = '/api/notice/details';  //公告详情

        //深圳徐总新增
        this.getApplyConfigApi = '/api/wallet/getApplyConfig';  //提现前获取
        this.withdrawalApplyApi = '/api/wallet/withdrawalApply';  //提现
        this.getWithdrawalRecordApi = '/api/wallet/getWithdrawalRecord';  //提现记录
        this.exchangeRecordApi = '/api/wallet/exchangeRecord';  //币种兑换记录
        this.exchangeApi = '/api/wallet/exchange';  //币种兑换
        this.getRateApi = '/api/wallet/getRate';  //币种前获取
        this.teamApi = '/api/user/getTeam';  //团队信息
        this.messageApi = '/api/user/message';  //专属留言
        this.messageRecordApi = '/api/user/messageRecord';  //专属留言
        this.getMessageDetailApi = '/api/user/getMessageDetail';  //留言详情
        this.daynetincomeApi = '/api/order/daynetincome';  //我的资产 量化资产
        this.CSQAApi = '/api/user/CSQA';  //我的资产 CSQA
        this.recommendBonusApi = '/api/user/recommendBonus';  //我的资产 推广收益
        this.cashAddressApi = '/api/user/cashAddress';  //我的资产 推广收益
        
        this.getRechargeRecordApi = '/api/wallet/getRechargeRecord';  //充值记录
        this.myAssetsApi = '/api/user/myAssets';  //我的资产
        this.myAssetsDetailApi = '/api/user/myAssetsDetail';  //我的资产明细
        this.withdrawalConfigApi = '/api/wallet/withdrawalConfig';  //获取提现参数
        this.dynamicIncomeApi = '/api/user/dynamicIncome';  //我的收益 动态
        this.staticIncomeApi = '/api/user/staticIncome';  //我的收益 静态
        this.getShowDataApi = '/api/index/getShowData';  //我的收益 静态
        this.messageRecordApi = '/api/user/messageRecord';  //留言
        this.messageApi = '/api/user/message';  //提交留言
        this.nicknameApi = '/api/user/nickname';  //提交留言
        this.isPowerChangAddressApi = '/api/user/isPowerChangAddress';  //钱包地址
        
        
    }
    
    isPowerChangAddress(params) {
        return axios.get(this.isPowerChangAddressApi,{params}).then((res) => res.data);
    }
    nicknameChange(params) {
        return axios.post(this.nicknameApi, qs.stringify(params)).then((res) => res.data);
    }
    tjMessage(params) {
        return axios.post(this.messageApi, qs.stringify(params)).then((res) => res.data);
    }
    messageRecord(params) {
        return axios.get(this.messageRecordApi,{params}).then((res) => res.data);
    }
    getShowData() {
        return axios.get(this.getShowDataApi).then((res) => res.data);
    }
    staticIncome() {
        return axios.get(this.staticIncomeApi).then((res) => res.data);
    }
    dynamicIncome(params) {
        return axios.get(this.dynamicIncomeApi, { params }).then((res) => res.data);
    }
    withdrawalConfig() {
        return axios.get(this.withdrawalConfigApi).then((res) => res.data);
    }
    myAssetsDetail(params) {
        return axios.get(this.myAssetsDetailApi, { params }).then((res) => res.data);
    }
    myAssets() {
        return axios.get(this.myAssetsApi).then((res) => res.data);
    }
    exchangeRate() {
        return axios.get(this.exchangeRateApi).then((res) => res.data);
    }
    getRechargeRecord(params) {
        return axios.get(this.getRechargeRecordApi, { params }).then((res) => res.data);
    }
    cashAddress(params) {
        return axios.post(this.cashAddressApi, qs.stringify(params)).then((res) => res.data);
    }
    getApplyConfig(params) {
        return axios.get(this.getApplyConfigApi, { params }).then((res) => res.data);
    }
    withdrawalApply(params) {
        return axios.post(this.withdrawalApplyApi, qs.stringify(params)).then((res) => res.data);
    }
    getWithdrawalRecord(params) {
        return axios.get(this.getWithdrawalRecordApi, { params }).then((res) => res.data);
    }
    exchangeRecord(params) {
        return axios.get(this.exchangeRecordApi, { params }).then((res) => res.data);
    }
    exchange(params) {
        return axios.post(this.exchangeApi, qs.stringify(params)).then((res) => res.data);
    }
    // getRate(params) {
    //     return axios.get(this.teamApi, { params }).then((res) => res.data);
    // }
    getRate(params) {
        return axios.post(this.getRateApi, qs.stringify(params)).then((res) => res.data);
    }
    team(params) {
        return axios.get(this.teamApi, { params }).then((res) => res.data);
    }
    message(params) {
        return axios.post(this.messageApi, qs.stringify(params)).then((res) => res.data);
    }
    messageRecord(params) {
        return axios.get(this.messageRecordApi, { params }).then((res) => res.data);
    }
    daynetincome(params) {
        return axios.post(this.daynetincomeApi, qs.stringify(params)).then((res) => res.data);
    }
    assetsCsqa(params) {
        return axios.get(this.CSQAApi, { params }).then((res) => res.data);
    }
    recommendBonus(params) {
        return axios.post(this.recommendBonusApi, qs.stringify(params)).then((res) => res.data);
    }





    getTeam(params) {
        return axios.get(this.teamApi, { params }).then((res) => res.data);
    }
    getPayInfo(params) {
        return axios.get(this.payInfoApi, { params }).then((res) => res.data);
    }
    getUserCoin(params) {
        return axios.get(this.userCoinApi, { params }).then((res) => res.data);
    }
    getCoinOrder(params) {
        return axios.get(this.coinOrderApi, { params }).then((res) => res.data);
    }
    getCoin(params) {
        return axios.post(this.coinApi, qs.stringify(params)).then((res) => res.data);
    }
    getTransfer(params) {
        return axios.post(this.transferApi, qs.stringify(params)).then(res => res.data);
    }
    shaitu(params) {
        return axios.post(this.shaituApi, qs.stringify(params)).then(res => res.data);
    }
    getRechargeInfo(params) {
        return axios.post(this.rechargeInfoApi, qs.stringify(params)).then(res => res.data);
    }
    recharge(params) {
        return axios.post(this.rechargeApi, qs.stringify(params)).then(res => res.data);
    }
    getBooklist(params) {
        return axios.get(this.booklistApi, { params }).then(res => res.data);
    }
    getSellInfo(params) {
        return axios.get(this.sellInfoApi, { params }).then(res => res.data);
    }
    bindAli(params) {
        return axios.post(this.bindaliApi, qs.stringify(params)).then(res => res.data);
    }
    bindwechat(params) {
        return axios.post(this.bindwechatApi, qs.stringify(params)).then(res => res.data);
    }
    getOrder(params) {
        return axios.get(this.orderListApi, { params }).then(res => res.data);
    }
    addBank(params) {
        return axios.post(this.bindbankApi, qs.stringify(params)).then(res => res.data);
    }
    buyStutas(params) {
        return axios.get(this.buystutasApi, { params }).then(res => res.data);
    }
    buyStutas2(params) {
        return axios.get(this.buystutas2Api, { params }).then(res => res.data);
    }
    buyAppeal(params) {
        return axios.get(this.buyappealApi, { params }).then(res => res.data);
    }
    sellStatus(params) {
        return axios.get(this.sellstatusApi, { params }).then(res => res.data);
    }
    sellStatus2(params) {
        return axios.get(this.sellstatus2Api, { params }).then(res => res.data);
    }
    sellStatus4(params) {
        return axios.get(this.sellstatus4Api, { params }).then(res => res.data);
    }
    sellAppeal(params) {
        return axios.get(this.sellappealApi, { params }).then(res => res.data);
    }
    setAppeal(params) {
        return axios.post(this.setappealApi, params).then(res => res.data);
    }
    minePay(params) {
        return axios.post(this.payApi, params).then(res => res.data);
    }
    buyer(params) {
        return axios.get(this.buyerApi, { params }).then(res => res.data);
    }
    getDialList(params) {
        return axios.get(this.diallistApi, { params }).then(res => res.data);
    }
    getReward(params) {
        return axios.get(this.rewardApi, { params }).then(res => res.data);
    }
    contract(params) {
        return axios.post(this.contractApi, qs.stringify(params)).then(res => res.data);
    }
    sellLog() {
        return axios.get(this.sellLogApi).then(res => res.data);
    }
    setSell(params) {
        return axios.post(this.setSellApi, qs.stringify(params)).then(res => res.data);
    }
    apply(params) {
        return axios.post(this.applyApi, qs.stringify(params)).then(res => res.data);
    }
    getapplyList(params) {
        return axios.get(this.applyLogApi, { params }).then(res => res.data);
    }
    getrate() {
        return axios.get(this.rateApi).then(res => res.data);
    }
    getKjfee() {
        return axios.get(this.kjfeeApi).then(res => res.data);
    }
    getTitle(params) {
        return axios.get(this.titleApi, { params }).then(res => res.data)
    }
    getNoticeDetail(params) {
        return axios.get(this.noticeDetailApi, { params }).then(res => res.data)
    }
    getMessageDetail(params) {
        return axios.get(this.getMessageDetailApi, { params }).then(res => res.data)
    }
}

/**
 *  帮助中心 
 */
export const Help = new class {
    constructor() {
        this.getCategoryListApi = '/api/question/getCategoryList';//全部问题
        this.getAllListApi = '/api/question/getAllList'
        this.getDetailApi = '/api/question/getDetail';//问题详情
        this.getCenterApi = '/api/question/getCenter';
        this.feedbackApi = '/api/question/addFeedback';  //提交问题

    }
    getCategoryList(params) {
        return axios.get(this.getCategoryListApi, { params }).then((res) => res.data)
    }
    getAllList(params) {
        return axios.get(this.getAllListApi, {params}).then((res) => res.data)
    }

    getDetail(params) {
        return axios.post(this.getDetailApi, qs.stringify(params)).then((res) => res.data)
    }
    getCenter(params) {
        return axios.get(this.getCenterApi, { params }).then((res) => res.data)
    }
    addFeedback(params) {
        return axios.post(this.feedbackApi, qs.stringify(params)).then((res) => res.data)
    }
}

/**
 * 主页
 */
export const Index = new class {
    constructor() {
        // this.fa_blockApi = '/api/user/fa_block';  //矿机这也列表
        this.fa_blockApi = '/api/ore/ore/getorelevel';  //矿机这也列表
        this.miningApi = '/api/mining/mining/index';  //抢矿
        this.oreResultApi = '/api/mining/mining/getOreResult';  //抢矿结果
        this.bookingApi = '/api/booking/booking/setBooking';  //预约
        this.countDownApi = '/api/ore/ore/countDown'; //抢矿倒计时
        this.titleApi = '/api/notice/gettitles';  //公告
        // this.bannerAPi = '/api/question/getTopImg';        
        this.bannerApi = '/api/index/getBanner';    //轮播  
        this.getPriceApi = '/api/index/getPrice';  //币种行情
        this.randomApi = '/api/order/random';  //首页机器人展示
        this.stateApi = '/api/order/state';  //首页机器人展示
        this.getArticleApi = '/api/index/getArticle';  //计划书 协议 关于我们
        this.planInfoApi = '/api/index/planInfo';  //首页计划信息
        this.changeApi = '/api/index/change';  //首页csqaK线图数据
    }
    getMine() {
        return axios.get(this.fa_blockApi).then((res) => res.data)
    }
    mining(params) {
        return axios.get(this.miningApi, { params }).then((res) => res.data)
    }
    booking(params) {
        return axios.get(this.bookingApi, { params }).then((res) => res.data)
    }
    getcountDown(params) {
        return axios.post(this.countDownApi, qs.stringify(params)).then(res => res.data)
    }
    getoreResult(params) {
        return axios.post(this.oreResultApi, qs.stringify(params)).then(res => res.data)
    }
    getTitle(params) {
        return axios.get(this.titleApi, { params }).then(res => res.data)
    }
    getBanner() {
        return axios.get(this.bannerApi).then(res => res.data)
    }
    getPrice(params) {
        return axios.get(this.getPriceApi, { params }).then(res => res.data)
    }
    random(params) {
        return axios.post(this.randomApi, qs.stringify(params)).then(res => res.data)
    }
    state(params) {
        return axios.post(this.stateApi, qs.stringify(params)).then(res => res.data)
    }
    getArticle(params) {
        return axios.get(this.getArticleApi, { params }).then(res => res.data)
    }
    planInfo(params) {
        return axios.get(this.planInfoApi, { params }).then(res => res.data)
    }
    csqaChange(params) {
        return axios.get(this.changeApi, { params }).then(res => res.data)
    }
}



// 交易中心&&节点套餐
export const Trade = new class {
    constructor(){
        this.ccOrderApi = '/api/cc/ccOrder';  //交易列表
        this.createBuyOrderApi = '/api/cc/createBuyOrder';  //创建买单
        this.createSellOrderApi = '/api/cc/createSellOrder';  //创建卖单
        this.detailOrderApi = '/api/cc/detailOrder';  //买卖单详情
        this.buyApi = '/api/cc/orderSellOrder';  //买入卖单
        this.saleApi = '/api/cc/orderBuyOrder';  //卖出买单
        this.payApi = '/api/cc/payOrder'; //买家付款
        this.saleconfirmApi = '/api/cc/dealOrder'; //卖家确定
        this.complaintApi = '/api/cc/complaint'; //申诉
        this.CcdetailsApi = '/api/log/Ccdetails'; //币种更变记录
        this.getCcParamApi = '/api/cc/getCcParam'; //买卖单参数信息
        this.getlistApi = '/api/tcbuy/getlist'; //节点算力套餐列表
        this.getAgreementApi = '/api/tcbuy/getAgreement'; //协议内容
        this.detailApi = '/api/tcbuy/detail'; //套餐详情
        this.buylistApi = '/api/buyorder/buylist'; //买单中心列表
        this.sellListApi = '/api/sellorder/sellList'; //卖单中心列表
        this.sellOrderApi = '/api/sellorder/addOrder'; //创建买单
        this.buyOrderApi = '/api/buyorder/addOrder'; //创建买单
        this.buydetailApi = '/api/buyorder/detail'; //买单中心列表详情
        this.selldetailApi = '/api/sellorder/detail'; //卖单中心列表详情
        this.buyorderpayApi = '/api/buyorder/payment'; //买单中心列表
        this.sellorderpayApi = '/api/sellorder/payment'; //卖单中心列表
        this.buyorderlistApi = '/api/buyorder/getlist'; //我的买单列表
        this.sellorderlistApi = '/api/sellorder/getlist'; //我的卖单列表
        this.addOrderBuyApi = '/api/sellorder/addOrderBuy'; //通过买单创建卖单
        this.addOrderSellApi = '/api/buyorder/addOrderSell'; //通过卖单创建买单
        this.buytcApi = '/api/tcbuy/buytc'; //租用套餐
        this.qxbuyorderApi = '/api/buyorder/abolish'; //取消买单
        this.qxsellorderApi = '/api/sellorder/abolish'; //取消卖单
        this.fcRateApi = '/api/index/fcRate'; //折线图
        this.mysellListApi = '/api/tcbuy/mysellList'; //我的算力套餐
        this.tcUpApi = '/api/tcbuy/tcUp'; //套餐升级
        this.myTcDetailApi = '/api/tcbuy/myTcDetail'; //套餐详情2
        this.getUpTcApi = '/api/tcbuy/getUpTc'; //套餐详情2

    }
    
    getUpTc(params){
        return axios.get(this.getUpTcApi,{ params }).then((res)=>res.data);
    }
    myTcDetail(params){
        return axios.get(this.myTcDetailApi,{ params }).then((res)=>res.data);
    }
    tcUp(params){
        return axios.post(this.tcUpApi,qs.stringify(params)).then((res)=>res.data);
    }
    mysellList(params){
        return axios.get(this.mysellListApi,{ params }).then((res)=>res.data);
    }
    fcRate(){
        return axios.get(this.fcRateApi).then((res)=>res.data);
    }
    qxbuyorder(params){
        return axios.get(this.qxbuyorderApi,{ params }).then((res)=>res.data);
    }
    qxsellorder(params){
        return axios.get(this.qxsellorderApi,{ params }).then((res)=>res.data);
    }
    buytc(params){
        return axios.post(this.buytcApi,qs.stringify(params)).then((res)=>res.data);
    }
    addOrderSell(params){
        return axios.post(this.addOrderSellApi,qs.stringify(params)).then((res)=>res.data);
    }
    addOrderBuy(params){
        return axios.post(this.addOrderBuyApi,qs.stringify(params)).then((res)=>res.data);
    }
    buyorderlist(params){
        return axios.get(this.buyorderlistApi,{ params }).then((res)=>res.data);
    }
    sellorderlist(params){
        return axios.get(this.sellorderlistApi,{ params }).then((res)=>res.data);
    }
    sellorderpay(params){
        return axios.post(this.sellorderpayApi,qs.stringify(params)).then((res)=>res.data);
    }
    buyorderpay(params){
        return axios.post(this.buyorderpayApi,qs.stringify(params)).then((res)=>res.data);
    }
    buydetail(params){
        return axios.get(this.buydetailApi,{ params }).then((res)=>res.data);
    }
    selldetail(params){
        return axios.get(this.selldetailApi,{ params }).then((res)=>res.data);
    }
    sellList(params){
        return axios.get(this.sellListApi,{ params }).then((res)=>res.data);
    }
    buyOrder(params){
        return axios.post(this.buyOrderApi,qs.stringify(params)).then((res)=>res.data);
    }
    sellOrder(params){
        return axios.post(this.sellOrderApi,qs.stringify(params)).then((res)=>res.data);
    }
    buylist(params){
        return axios.get(this.buylistApi,{ params }).then((res)=>res.data);
    }
    detail(params){
        return axios.get(this.detailApi,{ params }).then((res)=>res.data);
    }
    getAgreement(){
        return axios.get(this.getAgreementApi).then((res)=>res.data);
    }
    getlist(){
        return axios.get(this.getlistApi).then((res)=>res.data);
    }
    getCcParam(){
        return axios.get(this.getCcParamApi).then((res)=>res.data);
    }
    Ccdetails(params){
        return axios.get(this.CcdetailsApi,{params}).then((res)=>res.data);
    }
    complaint(params){
        return axios.post(this.complaintApi,qs.stringify(params)).then((res)=>res.data);
    }
    saleConfirm(params){
        return axios.post(this.saleconfirmApi,qs.stringify(params)).then((res)=>res.data);
    }
    buy(params){
        return axios.post(this.buyApi,qs.stringify(params)).then((res)=>res.data);
    }
    pay(params){
        return axios.post(this.payApi,qs.stringify(params)).then((res)=>res.data);
    }
    sale(params){
        return axios.post(this.saleApi,qs.stringify(params)).then((res)=>res.data);
    }
    detailOrder(params){
        return axios.post(this.detailOrderApi,qs.stringify(params)).then((res) => res.data)
    }
    createSellOrder(params){
        return axios.post(this.createSellOrderApi,qs.stringify(params)).then((res) => res.data)
    }
    createBuyOrder(params){
        return axios.post(this.createBuyOrderApi,qs.stringify(params)).then((res) => res.data)
    }
    getOrder(params){
        return axios.post(this.ccOrderApi,qs.stringify(params)).then((res) => res.data)
    }
}

/**
 * otc交易
 */
export const Business = new class{
    constructor(){
        this.createBuyApi = '/api/otc/otc/createBuyOrder';//创建买单
        this.createSellApi = '/api/otc/otc/createSellOrder';//创建卖单
        this.busConfigApi = '/api/otc/otc/getCcParam';//币种参数
        this.myOrderApi = '/api/otc/otc/trade_my';//我的买卖单  type 1买单 2卖单 page
        this.allOrderApi = '/api/otc/otc/trade_hall';//交易中心  type 1买单 2卖单 page
        this.payOrderApi = '/api/otc/otc/payOrder';//买家付款
        this.dealOrderApi = '/api/otc/otc/dealOrder';//卖家确认
        this.oDetailApi = '/api/otc/otc/detailOrder';//订单详情
        this.tradeNumApi = '/api/otc/otc/tradenum';//当天成交量
        this.revokeOrderApi = '/api/otc/otc/revokeOrder';//撤单
        this.appealOrderApi = '/api/otc/otc/complaint';//申诉
        this.sellBApi = '/api/otc/otc/orderBuyOrder';//卖出买单
        this.buySApi = '/api/otc/otc/orderSellOrder';//买入卖单
    }
    sellB(params){
        return axios.post(this.sellBApi,qs.stringify(params)).then((res) => res.data)
    }
    buyS(params){
        return axios.post(this.buySApi,qs.stringify(params)).then((res) => res.data)
    }
    createBuy(params){
        return axios.post(this.createBuyApi,qs.stringify(params)).then((res) => res.data)
    }
    createSell(params){
        return axios.post(this.createSellApi,qs.stringify(params)).then((res) => res.data)
    }
    getBusConfig(){
        return axios.get(this.busConfigApi).then((res)=>res.data);
    }
    getMyOrder(params){
        return axios.get(this.myOrderApi,{params}).then((res)=>res.data);
    }
    payOrder(params){
        return axios.post(this.payOrderApi,qs.stringify(params)).then((res) => res.data)
    }
    dealOrder(params){
        return axios.post(this.dealOrderApi,qs.stringify(params)).then((res) => res.data)
    }
    allOrder(params){
        return axios.get(this.allOrderApi,{params}).then((res)=>res.data);
    }
    oDetail(params){
        return axios.get(this.oDetailApi,{params}).then((res)=>res.data);
    }
    getTradeNum(){
        return axios.get(this.tradeNumApi).then((res)=>res.data);
    }
    revokeOrder(params){
        return axios.post(this.revokeOrderApi,qs.stringify(params)).then((res) => res.data)
    }
    appealOrder(params){
        return axios.post(this.appealOrderApi,qs.stringify(params)).then((res) => res.data)
    }
}